<!DOCTYPE html>
<html lang="en">
<head>
    <title>今日数据</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <script src="https://file.ggxqce.com/web/vue.min.js"></script>

    <style>
        [v-cloak] {
            display: none;
        }

        * {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            font-size: 12px;
        }

        body {
            margin: 1px;
            background: #f8f8f8;
        }

        table {
            border-spacing: 0;
            border-collapse: collapse;
            display: table;
        }

        .weather {
            text-align: center;
            font-size: 16px;
            position: absolute;
            top: 5px;
            line-height: 30px;
            float: left;
        }

        th {
            font-weight: bold;
        }

        table.text-center, table.text-center td, table.text-center th {
            text-align: center;
            font-size: 12px;
        }

        .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
            border: 1px solid #cbcbcd;
            height: 24px;
            position: relative;
            color: #333;
            padding: 0 4px;
        }

        table th {
            background: #f8f8f8;
        }

        .table-bordered {
            border: 1px solid #cbcbcd;
        }

        .table {
            width: 100%;
            max-width: 100%;
        }

        .hidden {
            display: none;
        }

        .lineOne, .lineTwo {
            text-align: left;
        }

        .tdColor {
            background-color: #f8f8f8;
            font-weight: bold;
        }

        .lineOne span {
            max-height: 24px;
            line-height: 24px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .lineTwo span {
            max-height: 48px;
            line-height: 14px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 3;
            text-align: left;

        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .clear {
            clear: both
        }

        .boxItem {
            width: 100%;
            padding: 10px;
            padding-top: 5px;
            padding-bottom: 0;
            background: inherit;
            background-color: rgba(255, 255, 255, 1);
            border: none;
            position: relative;
        }

        .boxItemTitle {
            color: #2c8cec;
            font-size: 22px;
            font-weight: bold;
            margin-bottom: 6px;
            text-align: center;
        }

        .home {
            font-size: 14px;
            font-weight: bold;
            margin-bottom: 10px;
            height: 14px;
            line-height: 14px;
            text-align: center;
        }

        .dian-icon {
            background: url("/dist/img/dian.png") no-repeat;
            background-size: cover;
            width: 14px;
            height: 14px;
            display: inline-block;
        }

        .jiaobiao, .jiaobiaoNew {
            position: relative;
        }

        .jiaobiao i {
            display: block;
            width: 0;
            height: 0;
            border-width: 0px 0 12px 12px;
            border-style: solid;
            border-color: transparent transparent transparent #2a8cec;
            position: absolute;
            top: 0px;
            left: 0px;
        }

        .jiaobiaoNew i {
            display: block;
            width: 12px;
            height: 12px;
            background: url("/dist/img/newLog2.png");
            background-size: 100% 100%;
            position: absolute;
            top: 0px;
            left: 0px;
        }

        .lineImg {
            padding-top: 5px !important;
            padding-bottom: 10px !important;
        }

        .lineImg img {
            height: 45px;
            width: 45px;
            float: left;
            margin: 10px;
        }

        .newCustomer {
            background: url(/dist/img/new.png) no-repeat;
            background-size: cover;
            width: 20px;
            height: 20px;
            right: 0;
            top: 2px;
            position: absolute;
        }

        .wajueji {
            padding-left: 140px;
            background: url("/dist/img/wajueji.png") no-repeat;
            background-size: 120px 88px;
            height: 88px;
            line-height: 88px;
            color: red;
            font-size: 14px;
            font-weight: bold;
            margin-left: 50px;
        }

        .qipao {
            /*background: url(/dist/img/qipao.png);*/
            background-size: 100% 100%;
            height: 88px;
            /* padding: 0 20px; */
            padding-left: 20px;
            /*padding-right: 20px;*/
            color: red;
            line-height: 88px;
            float: left;
            font-size: 14px;
            font-weight: bold;
        }

        .plan1 {
            background: url("/dist/img/plan1.png") no-repeat center center;
            background-size: 100%;
        }

        .plan2 {
            background: url("/dist/img/plan2.png") no-repeat center center;
            background-size: 100%;
        }

        .plan3 {
            background: url("/dist/img/plan3.png") no-repeat center center;
            background-size: 100%;
        }

        .boxItemTitleNotice {
            color: red;
            font-size: 22px;
            font-weight: bold;
            margin-bottom: 10px;
            text-align: center;
        }

        .boxItemTitleNotice i {
            background: url("/dist/img/jg.png") no-repeat center center;
            height: 22px;
            width: 22px;
            background-size: cover;
            display: inline-block;
            margin-bottom: -3px;
            margin-left: 5px;
        }

        .boxItemTitleNoticeTime {
            color: red;
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 10px;
            text-align: center;
        }

        .boxItemTitleNoticeTime i {
            background: url("/dist/img/jg.png") no-repeat center center;
            height: 16px;
            width: 16px;
            background-size: cover;
            display: inline-block;
            margin-bottom: -3px;
            margin-left: 5px;
        }

        .search-button {
            width: 14px;
            height: 14px;
            background-image: url(/dist/img/glass.jpg);
            border: 0 none;
            cursor: pointer;
            margin-top: 0px;
        }

        input[type=button] {
            outline: none;
        }

        .oaBtn {
            background: url(/dist/img/btn-bj2.png) repeat-y !important;
            background-size: 100% 100% !important;
            color: #fff !important;
        }

        .btn-group-sm > .btn, .btn-sm {
            padding: 2px 10px;
        }

        .btn {
            border-radius: 3px;
            -webkit-box-shadow: none;
            box-shadow: none;
            border: 1px solid transparent;
        }

        .pull-right {
            float: right !important;
        }

        .blue {
            color: #39c;
        }

        .red {
            color: #e03800;
        }

        .weather img {
            height: 30px;
            width: 30px;
            float: left;
        }
    </style>
</head>
<body>
<section class="content" id="app" v-cloak style="background: #eee;padding: 20px 10px;">
    <div class="div-td-content-more"><i></i></div>
    <input type="button" value="轨迹" class="oa-pager-button btn oaBtn btn-sm pull-left"
           style="right: 70px;top: 10px;position: absolute;padding: 2px 4px;" @click="track"  v-if="getUrlParamObj().userId=='2018031410554B478CA5AB94A01CEAB6'">
    <template v-if="sign.signState==1">
        <div class="templateStyle" v-if="isHasModule('signInPersonal')">
            <div class="boxItem" style="height: 80vh">
                <div class="boxItemTitle">请假</div>
                <div class="boxBoy" style="text-align: center">
                    <img src="/dist/img/qinjia.png" alt="" style="margin-top: 50px;margin-right: -30px;">
                    <div class="home" style="margin-top:100px;">{{sign.remark}}</div>
                </div>
                <div class="clear"></div>
            </div>
        </div>
    </template>
    <template v-else-if="sign.signState==2">
        <div class="templateStyle" v-if="isHasModule('signInPersonal')">
            <div class="boxItem" style="height: 80vh">
                <div class="boxItemTitleNotice">缺勤</div>
                <div class="boxBoy" style="text-align: center">
                    <img src="/dist/img/qinjia2.png" alt="" style="margin-top: 50px;margin-right: -30px;">
                    <div class="home" style="margin-top:100px;">{{sign.remark}}</div>
                </div>
                <div class="clear"></div>
            </div>
        </div>
    </template>
    <template v-else>
        <div class="templateStyle" v-if="isHasModule('signInPersonal')">
            <div class="boxItem">
                <!--<div class="boxItemTitle">考勤</div>-->
                <div class="boxItemTitle">考勤</div>
                <div class="weather" v-if="weather.text_day"><b style="margin: 0 2px;">{{weather.text_day}}</b><font
                        class="blue">{{weather.low}}</font>～<font class="red">{{weather.high}}℃</font><img
                        :src="'/dist/img/weather/'+weather.code_day+'.png'"></img></div>
                <input type="button" value="查看基本信息" class="oa-pager-button btn oaBtn btn-sm pull-right"
                       style="right: 10px;top: 10px;position: absolute;padding: 2px 4px;" @click="lookDetail" >
                <div class="boxBoy" style="line-height: 1">

                    <template v-if="sign">
                        <div v-if="sign.signState==1" class="home"><i class="dian-icon"></i>{{"请假。原因："+sign.remark}}
                        </div>
                        <div v-else-if="sign.signState==2&&sign.remind==1" class="home"><span
                                style="color:red;font-family: '宋体'">缺勤</span>
                        </div>
                        <img v-if="sign.signUrl" :src="sign.signUrl"
                             alt="" style="width: 100%; height: 100%;display: block;margin-bottom: -10px">
                        <img v-if="sign.signUrl && sign.signOutAddress" :src="sign.signOutUrl"
                             alt="" style="width: 100%; height: 100%;margin-top: 10px;">
                    </template>

                </div>
            </div>
        </div>
        <div class="templateStyle" v-if="isHasModule('tomorrowPlan')">
            <div class="boxItem">
                <div class="boxItemTitle" >今日计划
                    <!--v-if="tomorrowPlan.len=='0'||tomorrowPlan.len==''"-->
                    <input type="button" value="编辑计划" class="oa-pager-button btn oaBtn btn-sm pull-right"
                           style="margin-top: 5px;margin-left: -70px;" @click="plan" v-if="hour<9&&editable==='true'">
                </div>
                <div class="boxBoy">
                    <table :class="returnPlanClass(tomorrowPlan.len)">
                        <tbody>
                        <tr>
                            <th style="width: 25%;">拜访目的</th>
                            <th style="width: 25%;">名称</th>
                            <th style="width: 50%;">地点</th>
                        </tr>
                        <tr v-for="(item,i) in tomorrowPlan">
                            <td>{{item.visitGoal}}</td>
                            <td>{{item.customerName}}</td>
                            <td class="lineOne"><span>{{item.customerAddress}}</span></td>
                        </tr>
                        </tbody>
                    </table>
                    <!--<div><img src="/dist/img/wajueji.png" alt="" style="height: 88px;float:left;">-->
                    <!--<div class="qipao">要认真填写计划哦！</div>-->
                    <!--</div>-->
                    <!--<div class="wajueji" v-if="tomorrowPlan.len>0&&tomorrowPlan.len<3">要认真填写计划哦！</div>-->
                    <!--<div class="wajueji" v-else-if="tomorrowPlan.len>=3&&tomorrowPlan.len<=6">计划不错，继续努力哦！</div>-->
                    <!--<div class="wajueji" v-else-if="tomorrowPlan.len>=6">计划满满，相当不错！</div>-->
                </div>
                <div class="clear"></div>
            </div>
        </div>
        <div class="templateStyle" v-if="isHasModule('visitPersonal')">
            <div class="boxItem">

                <div class="boxItemTitle" >今日面访
                    <input type="button" value="轨迹" class="oa-pager-button btn oaBtn btn-sm pull-left"
                           style="right: 70px;top: 10px;position: absolute;padding: 2px 4px;" @click="track"  v-if="showTrack=='true'">
                    <input type="button" value="客户列表" class="oa-pager-button btn oaBtn btn-sm pull-right"
                           style="right: 10px;top: 10px;position: absolute;padding: 2px 4px;" @click="cusList" >
                </div>
                <div class="boxBoy">
                    <table  v-if="visit.length<=0||!visit" style="text-align: center;color:#333;padding-bottom: 5px;" class="table table-bordered text-center table-width"><tr><td>暂无面访记录</td></tr></table>

                    <table class="table table-bordered text-center table-width" v-for="(customer,i) in  visit">
                        <tbody>
                        <template v-if="customer.areaType=='1'&&customer.frontFlag=='1'&&customer.entourage!='无'">
                             <tr>
                                 <td :class="customer.newCustomer=='1'?'tdColor jiaobiaoNew':'tdColor jiaobiao'" style="width: 25%;">
                                     <i></i>陪同人
                                 </td>
                                 <td  style="width: 25%;"><span>{{customer.entourage}}</span></td>
                                 <td class="tdColor"  style="width: 25%;">拜访时长</td>
                                <td  style="width: 25%;"><span>{{customer.time}}分</span></td>
                             </tr>
                        </template>
                        <template v-else>
                            <tr>
                                <td :class="customer.newCustomer=='1'?'tdColor jiaobiaoNew':'tdColor jiaobiao'"
                                    style="width: 25%;"><i></i>客户姓名
                                </td>
                                <td>{{customer.name}}</td>
                                <td class="tdColor" style="width: 25%;">客户电话</td>
                                <td style="width: 25%;"><span>{{trims(customer.tel)}}</span></td>
                            </tr>
                            <tr>
                                <td class="tdColor">客户微信</td>
                                <td><span>{{trims(customer.wechat)}}</span></td>
                                <td class="tdColor">陪同人</td>
                                <td><span>{{customer.entourage}}</span></td>
                            </tr>
                            <tr>
                                <td class="tdColor">客户类型</td>
                                <td ><span>{{customer.customerType?customer.customerType:"-"}}</span></td>
                                <td class="tdColor">客户信用</td>
                                <td ><span>{{customer.customerCredit?customer.customerCredit:"-"}}</span></td>
                            </tr>
                            <tr>
                                <td class="tdColor">拜访时间</td>
                                <td>
                                    <span>{{customer.arrivalsTime?customer.arrivalsTime:"-"}}/{{customer.leaveTime?customer.leaveTime:"-"}}</span>
                                </td>
                                <td class="tdColor">拜访时长</td>
                                <td><span>{{customer.time}}分</span></td>
                            </tr>
                        </template>
                        <tr>
                            <td class="tdColor">图片</td>
                            <td class="lineImg" colspan="3">
                                <div v-if="customer.arrivalsImg" style="border: 1px solid #cbcbcd;width: 45px;height: 45px;float: left;margin: 10px;">
                                    <img v-if="customer.arrivalsImg" :src="customer.arrivalsImg"
                                         @click="openImg(customer.arrivalsImg)" style="margin: 0;">
                                    <span style="margin-top: 5px;margin-bottom:5px;color: #797878;">签到</span>
                                </div>
                                <div v-else style="border: 1px solid #cbcbcd;width: 45px;height: 45px;float: left;margin: 10px;">
                                    <img src="/dist/img/zwImg.png" style="margin: 0;">
                                    <span style="margin-top: 5px;margin-bottom:5px;color: #797878;">未签到</span>
                                </div>
                                <div v-if="customer.leaveImg" style="border: 1px solid #cbcbcd;width: 45px;height: 45px;float: left;margin: 10px;">
                                    <img v-if="customer.leaveImg" :src="customer.leaveImg"
                                         @click="openImg(customer.leaveImg)" style="margin: 0;">
                                    <span style="margin-top: 5px;margin-bottom:5px;color: #797878;">签退</span>
                                </div>
                                <div v-else style="border: 1px solid #cbcbcd;width: 45px;height: 45px;float: left;margin: 10px;">
                                    <img src="/dist/img/zwImg.png" style="margin: 0;">
                                    <span style="margin-top: 5px;margin-bottom:5px;color: #797878;">签退</span>
                                </div>
                            </td>

                        </tr>
                        <tr>
                            <td class="tdColor">基本情况</td>
                            <td colspan="3" class="lineTwo"><span>{{customer.otherCondition}}</span></td>
                        </tr>
                        <tr v-if="i==0">
                            <td class="tdColor" colspan="3">考勤签到时间与拜访时间 时间间隔</td>
                            <td>{{customer.timeInterval}}<i v-if="customer.remind=='1'" class="fa fa-question" style="color:red;font-size: 15px;margin-left: 2px;"></i>
                            </td>
                        </tr>
                        <tr v-if="i==0">
                            <td class="tdColor" colspan="3">考勤签到地点与拜访地点 距离间隔</td>
                            <td>{{customer.distance}}</td>
                        </tr>
                        <tr v-if="i==0">
                            <td class="tdColor" colspan="3">时速</td>
                            <td>{{clearKil(customer.speed)}}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="clear"></div>
            </div>
        </div>
        <div class="templateStyle" v-if="isHasModule('bigRegionCustomerList')">
            <div class="boxItem">
                <!--v-if="isHasModule('customerBigRegion')"-->
                <div class="boxItemTitle">意向客户</div>
                <div class="boxBoy">
                    <table  v-if="customerBig.length<=0||!customerBig" style="text-align: center;color:#333;padding-bottom: 5px;" class="table table-bordered text-center table-width"><tr><td>暂无意向客户</td></tr></table>

                    <table class="table table-bordered text-center table-width">
                        <tbody>
                        <tr>
                            <td class="tdColor jiaobiao" style="width: 25%;">区域经理</td>
                            <td class="tdColor" style="width: 25%;">客户姓名</td>
                            <td class="tdColor" style="width: 25%;">购买日期</td>
                            <td class="tdColor">最近一次跟踪日期</td>
                        </tr>
                        <tr v-for="(item,i) in customerBig">
                            <td style="width: 25%;">
                        <span>
                            {{item.userName}}
                        </span></td>
                            <td @click="openCustomerList(item.customerId,item.customerName,item.userId)"
                                style="color: #169BD5;cursor: pointer;width: 25%;">
                            <span>
                                {{item.customerName}}
                            </span>
                            </td>
                            <td><span>{{item.buyDate}}</span></td>
                            <td><span>{{item.visitTime}}</span></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="clear"></div>
            </div>
        </div>
        <div class="templateStyle" v-if="isHasModule('serviceVisitPersonal')">
            <!--今日面访-服务人员-->
            <div class="boxItem">

                <div class="boxItemTitle" >今日面访
                    <input type="button" value="轨迹" class="oa-pager-button btn oaBtn btn-sm pull-left"
                           style="right: 70px;top: 10px;position: absolute;padding: 2px 4px;" @click="track"  v-if="showTrack=='true'">
                    <input type="button" value="客户列表" class="oa-pager-button btn oaBtn btn-sm pull-right"
                           style="right: 10px;top: 10px;position: absolute;padding: 2px 4px;" @click="cusList" >
                </div>
                <div class="boxBoy">
                    <table v-if="visit.length<=0||!visitr" style="text-align: center;color:#333;padding-bottom: 5px;" class="table table-bordered text-center table-width"><tr><td>暂无面访记录</td></tr></table>

                    <table class="table table-bordered text-center table-width" v-for="(customer,i) in  visit">
                        <tbody>
                            <tr>
                                <td :class="customer.newCustomer=='1'?'tdColor jiaobiaoNew':'tdColor jiaobiao'"
                                    style="width: 25%;"><i></i>客户姓名
                                </td>
                                <td>{{customer.name}}</td>
                                <td class="tdColor" style="width: 25%;">客户电话</td>
                                <td style="width: 25%;"><span>{{trims(customer.tel)}}</span></td>
                            </tr>
                            <tr>
                                <td class="tdColor">客户类型</td>
                                <td><span>{{customer.serverCustomerType?customer.serverCustomerType:"-"}}</span></td>
                                <td class="tdColor">客户信用</td>
                                <td><span>{{customer.customerCredit?customer.customerCredit:"-"}}</span></td>
                            </tr>
                            <tr>
                                <td class="tdColor">客户微信</td>
                                <td><span>{{customer.wechat?trims(customer.wechat):"-"}}</span></td>
                                <td class="tdColor">陪同人</td>
                                <td><span>{{customer.entourage}}</span></td>
                            </tr>
                            <tr>
                                <td class="tdColor">机型</td>
                                <td>
                                    <span>{{customer.intentionModel?customer.intentionModel:"-"}}</span>
                                </td>
                                <td class="tdColor">服务类型</td>
                                <td><span>{{customer.otherVisitType}}分</span></td>
                            </tr>
                            <tr>
                                <td class="tdColor">序列号</td>
                                <td colspan="3">
                                    <span>{{customer.serialNo?customer.serialNo:"-"}}</span>
                                </td>
                            </tr>
                            <tr>
                                <td class="tdColor">配件收费</td>
                                <td>
                                    <span>{{customer.accessoriesChargesCondition?customer.accessoriesChargesCondition+"元":"-"}}</span>
                                </td>
                                <td class="tdColor">工时费用</td>
                                <td><span>{{customer.hoursChargesCondition?customer.hoursChargesCondition+"元":"-"}}</span></td>
                            </tr>
                            <tr>
                                <td class="tdColor">拜访时间</td>
                                <td>
                                    <span>{{customer.arrivalsTime?customer.arrivalsTime:"-"}}/{{customer.leaveTime?customer.leaveTime:"-"}}</span>
                                </td>
                                <td class="tdColor">拜访时长</td>
                                <td><span>{{customer.time}}分</span></td>
                            </tr>
                        <tr>
                            <td class="tdColor">图片</td>
                            <td class="lineImg" colspan="3">
                                <img v-if="customer.leaveImg" :src="customer.leaveImg"
                                     @click="openImg(customer.leaveImg)">
                            </td>

                        </tr>
                        <tr>
                            <td class="tdColor">服务内容</td>
                            <td colspan="3" class="lineTwo"><span>{{customer.serverCondition}}</span></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="clear"></div>
            </div>
        </div>
        <div class="templateStyle" v-if="isHasModule('otherVisitPersonal')">
            <!--今日面访-债权信审-->
            <div class="boxItem">

                <div class="boxItemTitle" >今日面访
                    <input type="button" value="轨迹" class="oa-pager-button btn oaBtn btn-sm pull-left"
                           style="right: 70px;top: 10px;position: absolute;padding: 2px 4px;" @click="track"  v-if="showTrack=='true'">
                    <input type="button" value="客户列表" class="oa-pager-button btn oaBtn btn-sm pull-right"
                           style="right: 10px;top: 10px;position: absolute;padding: 2px 4px;" @click="cusList" >
                </div>
                <div class="boxBoy">
                    <table v-if="visit.length<=0||!visitr" style="text-align: center;color:#333;padding-bottom: 5px;" class="table table-bordered text-center table-width"><tr><td>暂无面访记录</td></tr></table>

                    <table class="table table-bordered text-center table-width" v-for="(customer,i) in  visit">
                        <tbody>
                        <tr>
                            <td :class="customer.newCustomer=='1'?'tdColor jiaobiaoNew':'tdColor jiaobiao'"
                                style="width: 25%;"><i></i>客户姓名
                            </td>
                            <td>{{customer.name}}</td>
                            <td class="tdColor" style="width: 25%;">客户电话</td>
                            <td style="width: 25%;"><span>{{trims(customer.tel)}}</span></td>
                        </tr>
                        <tr>
                            <td class="tdColor">拜访类型</td>
                            <td ><span>{{customer.otherVisitType?customer.otherVisitType:"-"}}</span></td>
                            <td class="tdColor">客户信用</td>
                            <td><span>{{customer.customerCredit?customer.customerCredit:"-"}}</span></td>
                        </tr>
                        <tr>
                            <td class="tdColor">客户微信</td>
                            <td><span>{{customer.wechat?trims(customer.wechat):"-"}}</span></td>
                            <td class="tdColor">陪同人</td>
                            <td ><span>{{customer.entourage}}</span></td>
                        </tr>
                        <tr>
                            <td class="tdColor">拜访时间</td>
                            <td>
                                <span>{{customer.arrivalsTime?customer.arrivalsTime:"-"}}/{{customer.leaveTime?customer.leaveTime:"-"}}</span>
                            </td>
                            <td class="tdColor">拜访时长</td>
                            <td><span>{{customer.time}}分</span></td>
                        </tr>
                        <tr>
                            <td class="tdColor">图片</td>
                            <td class="lineImg" colspan="3">
                                <img v-if="customer.leaveImg" :src="customer.leaveImg"
                                     @click="openImg(customer.leaveImg)">
                            </td>

                        </tr>
                        <tr>
                            <td class="tdColor">基本情况</td>
                            <td colspan="3" class="lineTwo"><span>{{customer.debtCondition}}{{customer.lettersCondition}}</span></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="clear"></div>
            </div>
        </div>
        <div class="templateStyle" v-if="isHasModule('personalCustomerList')">
            <div class="boxItem">
                <!--v-if="isHasModule('customerRegion')"-->
                <div class="boxItemTitle">意向客户</div>
                <div class="boxBoy">
                    <table v-if="customer.length<=0||!customer" style="text-align: center;color:#333;padding-bottom: 5px;" class="table table-bordered text-center table-width"><tr><td>暂无意向客户</td></tr></table>
                    <table class="table table-bordered text-center table-width" v-for="(item,i) in customer">
                        <tbody>
                        <tr>
                            <td class="tdColor jiaobiao" style="width: 25%;"><i></i>客户姓名</td>
                            <td @click="openCustomerList(item.id,item.name)"
                                style="color: #169BD5;cursor: pointer;width: 25%;">
                        <span>
                            {{item.name}}
                        </span>
                            </td>
                            <td class="tdColor" style="width: 25%;">客户电话</td>
                            <td style="width: 25%;"><span>{{item.tel}}</span></td>
                        </tr>
                        <tr>
                            <td class="tdColor">客户类型</td>
                            <td ><span>{{item.customerType?item.customerType:"-"}}</span></td>
                            <td class="tdColor">客户信用</td>
                            <td ><span>{{item.customerCredit?item.customerCredit:"-"}}</span></td>
                        </tr>
                        <tr>
                            <td class="tdColor">客户所在地</td>
                            <td><span>{{item.provinceName?item.provinceName:"-"}}</span></td>
                            <td class="tdColor">购买时间</td>
                            <td><span>{{item.buyDate?item.buyDate:"-"}}</span></td>
                        </tr>
                        <tr>
                            <td class="tdColor">意向机型</td>
                            <td><span>{{item.intentionModel?item.intentionModel:"-"}}</span></td>
                            <td class="tdColor">购买方式</td>
                            <td><span>{{item.buyType?item.buyType:"-"}}</span></td>
                        </tr>
                        <tr>
                            <td class="tdColor">基本情况</td>
                            <td colspan="3" class="lineTwo"><span>{{item.otherCondition}}</span></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="clear"></div>
            </div>
        </div>

        <div class="templateStyle" v-if="isHasModule('wechat')">
            <div class="boxItem">
                <div class="boxItemTitle">微信转发</div>
                <div class="boxBoy">
                    <table v-if="wechat.length>0" class="table table-bordered text-center table-width">
                        <tbody>
                        <tr>
                            <th style="width: 20%;"><i></i>日期</th>
                            <th style="width: 60%;">转发标题</th>
                            <th style="width: 20%;">转发</th>
                        </tr>
                        <tr v-for="(item,i) in wechat">
                            <!--<td>{{i+1}}</td>-->
                            <td :rowspan="item.shareDatespan" :class="{hidden: item.shareDatedis}">
                                {{(item.shareDate).substr(5,10)}}
                            </td>

                            <td class="lineOne"><span>{{item.name}}</span></td>
                            <td>
                                <i v-if="item.nightFlag==1">
                                    <img style="width: 18px;" src="/dist/img/ic_app_right.png">
                                </i>
                                <i v-else-if="item.nightFlag==0||item.nightFlag=='-'">
                                    <img style="width: 18px;" src="/dist/img/ic_app_worng.png">
                                </i>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <table v-else style="text-align: center;color:#333;padding-bottom: 5px;" class="table table-bordered text-center table-width"><tr><td>暂无微信转发记录</td></tr></table>

                </div>
                <div class="clear"></div>
            </div>
        </div>
        <div class="templateStyle" v-if="isHasModule('wechatFriend')">
            <div class="boxItem">
                <div class="boxItemTitle">微信好友</div>
                <div class="boxBoy">
                    <table v-if="wechatFriend.length>=0" class="table table-bordered text-center table-width">
                        <tbody>
                        <tr>
                            <th style="width: 20%;"><i></i>日期</th>
                            <th style="width: 40%;">好友数</th>
                            <th style="width: 40%;">今日新增</th>
                        </tr>
                        <tr v-for="(item,i) in wechatFriend">
                            <td>{{(item.createTime).substr(5,10)}}</td>
                            <td v-if="item.img" @click="openImg(item.img)" style="color:#169BD5;cursor: pointer">
                                {{item.contact}}
                            </td>
                            <td v-else-if="item.contact=='请假'" style="color: red;">
                                {{item.contact}}
                            </td>
                            <td v-else>-</td>
                            <td>{{item.num?item.num:"-"}}</td>
                        </tr>
                        </tbody>
                    </table>
                    <table v-else style="text-align: center;color:#333;padding-bottom: 5px;" class="table table-bordered text-center table-width"><tr><td>暂无微信好友记录</td></tr></table>

                </div>
                <div class="clear"></div>
            </div>
        </div>
        <div class="templateStyle" v-if="isHasModule('workReport')">
            <div class="boxItem">
                <div class="boxItemTitle">工作报告</div>
                <div class="boxBoy">
                    <table v-if="workReport.length>0" class="table table-bordered text-center table-width">
                        <tbody>
                        <tr>
                            <th>应读数量</th>
                            <th>已读数量</th>
                            <th>未读数量</th>
                            <th>回复数量</th>
                        </tr>
                        <tr v-for="(item,i) in workReport">
                            <td >{{item.allCount}}</td>
                            <td >{{item.readedCount}}</td>
                            <td >{{item.unreadCount}}</td>
                            <td>{{item.replyCount}}</td>
                        </tr>
                        </tbody>
                    </table>
                    <table v-else style="text-align: center;color:#333;padding-bottom: 5px;" class="table table-bordered text-center table-width"><tr><td>暂无工作报告记录</td></tr></table>
                </div>
                <div class="clear"></div>
            </div>
        </div>
        <div class="templateStyle" v-if="isHasModule('cost')">
            <div class="boxItem">
                <div class="boxItemTitle">今日费用</div>
                <div class="boxBoy">
                    <table v-if="cost.length<=0||!cost" style="text-align: center;color:#333;padding-bottom: 5px;" class="table table-bordered text-center table-width"><tr><td>暂无费用记录</td></tr></table>
                    <table class="table table-bordered text-center table-width" v-for="(item,i) in cost">
                        <tbody>
                        <tr>
                            <td class="tdColor jiaobiao" style="width: 25%;"><i></i>费用类型</td>
                            <td style="width: 25%;"><span>{{item.costSmallName}}</span></td>
                            <td class="tdColor" style="width: 25%;">申请人</td>
                            <td style="width: 25%;"><span>{{item.userName}}</span></td>
                        </tr>
                        <!--油卡加油费-->
                        <template v-if="item.costSmallName=='油卡加油费'">
                            <tr>
                                <td class="tdColor">车牌号</td>
                                <td><span>{{item.license}}</span></td>
                                <td class="tdColor">公里数</td>
                                <td><span>{{item.mileage}}</span></td>
                            </tr>
                            <tr>
                                <td class="tdColor">金额(元)</td>
                                <td colspan="3"><span>{{item.money}}</span></td>
                            </tr>
                        </template>
                        <!--私车公用-->
                        <template v-if="item.costSmallName=='私车公用'">
                            <tr>
                                <td class="tdColor">出发前里程</td>
                                <td><span>{{item.beforeOffice}}</span></td>
                                <td class="tdColor">返回后里程</td>
                                <td><span>{{item.afterOffice}}</span></td>
                            </tr>
                            <tr>
                                <td class="tdColor">行驶里程</td>
                                <td><span>{{item.afterOffice-item.beforeOffice<0?0:item.afterOffice-item.beforeOffice}}公里</span></td>
                                <td class="tdColor">金额(元)</td>
                                <td><span>{{item.money}}</span></td>
                            </tr>
                        </template>
                        <!--住宿费-->
                        <template v-if="item.costSmallName=='住宿费'">
                            <tr>
                                <td class="tdColor">住宿人数</td>
                                <td><span>{{item.residence}}</span></td>
                                <td class="tdColor">金额(元)</td>
                                <td><span>{{item.money}}</span></td>
                            </tr>
                            <tr>
                                <td class="tdColor">宾馆名称</td>
                                <td colspan="3" style="text-align: center">{{item.hotelName}}</td>
                            </tr>
                            <tr>
                                <td class="tdColor">宾馆电话</td>
                                <td colspan="3" style="text-align: center">{{item.hotelTel}}</td>
                            </tr>
                        </template>
                        <!--招待费-->
                        <template v-if="item.costSmallName=='招待费'">
                            <tr>
                                <td class="tdColor">招待对象</td>
                                <td><span>{{item.host}}</span></td>
                                <td class="tdColor">招待人数</td>
                                <td><span>{{item.guests}}</span></td>
                            </tr>
                            <tr>
                                <td class="tdColor">预估金额</td>
                                <td><span>{{item.predictMoney}}</span></td>
                                <td class="tdColor">实际金额</td>
                                <td><span>{{item.money}}</span></td>
                            </tr>
                            <tr>
                                <td class="tdColor">饭店名称</td>
                                <td colspan="3" style="text-align: center">{{item.restaurantName}}</td>
                            </tr>
                        </template>
                        <!--其他-->
                        <template v-else>
                            <tr>
                                <td class="tdColor">金额(元)</td>
                                <td colspan="3"><span>{{item.money}}</span></td>
                            </tr>
                        </template>
                        <tr>
                            <td class="tdColor">有无发票</td>
                            <td colspan="3"><span>{{item.invoiceFlag=="1"?"有":"无"}}</span></td>
                        </tr>
                        <tr>
                            <td class="tdColor">说明</td>
                            <td colspan="3" class="lineTwo"><span>{{item.remark}}</span></td>
                        </tr>
                        <tr>
                            <td class="tdColor">附件</td>
                            <td class="lineImg" colspan="3">
                                <img v-for="(url,i) in (item.img).split(',')" :src="url" @click="openImg(item.img,i)"
                                     alt="">
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </template>
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="/dist/plugins/scroll/myScroll.js"></script>
<!--框架已定义 JS-->
<!--oa自定义  JS-->
<script src="/dist/js/oaApp.js"></script>

<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
</script>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            userId: getUrlParamObj().userId,
            userName: getUrlParamObj().userName,
            roleName: getUrlParamObj().roleName,
            yesterday: new Date(new Date() - 24 * 60 * 60 * 1000).Format("yyyy-MM-dd"),
            today: new Date().Format("yyyy-MM-dd"),
            hour: new Date().getHours(),
            thisMonth: new Date().Format("yyyy-MM"),
            thisWeek: new Date().Format("yyyy-MM-dd") + "-w",
            sign: {},
            tomorrowPlan: {},
            visit: [],
            wechat: {},
            wechatFriend: {},
            cost: {},
            customer: {},
            customerBig: {},
            weather: {},
            workReport:{},
            frontFlag: '',
            areaType: '',
            editable: getUrlParamObj().editable,
            showTrack: getUrlParamObj().showTrack

        },
        methods: {
            isHasModule: function (moduleEName) {
                return $.inArray(moduleEName, this.modules) > -1;
            },
            //获取modules
            getModules: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.report.config.module.getModuleENamesByUserId, {userId: getUrlParamObj().userId}, function (data) {
                    var eNames = [];
                    for (var i = 0; i < data.length; i++) {
                        if (data[i].appTodayReport == 1) {
                            eNames.push(data[i].eName);
                        }
                    }
                    that.modules = eNames;
                    console.log(that.modules)
                }, true);
            },
            //app打开图片
            openImg: function (url, index) {
                if (!index) {
                    index = 0
                }
                var obj = {
                    type: 'img',
                    imgList: url,
                    position: index,
                }
                prompt(JSON.stringify(obj))
            },
            returnPlanClass: function (length) {
                if (length == 0) {
                    return "table table-bordered text-center table-width plan1"
                }
                if (length > 0 && length < 6) {
                    return "table table-bordered text-center table-width plan2"
                }
                if (length >= 6) {
                    return "table table-bordered text-center table-width plan3"
                }
            },
            formatDate: function (now) {
                var d = new Date(now);
                var hour = d.getHours();
                var minute = d.getMinutes();
                var second = d.getSeconds();
                if (hour < 10) {
                    hour = "0" + hour;
                }
                if (minute < 10) {
                    minute = "0" + minute;
                }
                if (second < 10) {
                    second = "0" + second;
                }
                return hour + ":" + minute + ":" + second;
            },
            //获取合计
            getCount: function (arr, key) {
                var number = 0;
                for (var i = arr.length - 1; i >= 0; i--) {
                    number += (arr[i][key] && arr[i][key] != '-' ? arr[i][key] : 0)

                }
                return number;
            },
            //合并单元格
            tablesMergeCell: function (list) {
                for (field in list[0]) {
                    var k = 0;
                    while (k < list.length) {
                        list[k][field + 'span'] = 1;
                        list[k][field + 'dis'] = false;
                        for (var i = k + 1; i <= list.length - 1; i++) {
                            if (list[k][field] == list[i][field] && list[k][field] != '') {
                                list[k][field + 'span']++;
                                list[k][field + 'dis'] = false;
                                list[i][field + 'span'] = 1;
                                list[i][field + 'dis'] = true;
                            } else {
                                break;
                            }
                        }
                        k = i;
                    }
                }
                return list;
            },
            //获取天气
            get_weather: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.other.getTheWeather, {
                    "lat": that.sign.latitude,
                    "lng": that.sign.longitude
                }, function (data) {
                    that.weather = data.weather[0];
                    console.log(that.weather);
                });
            },
            //获取考勤信息
            get_signInPersonal: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.report.attendance.getSignPersonByToday, {
                    "userId": that.userId,
                    "dateTime": that.today
                }, function (data) {
                    that.sign = data;
                    that.get_weather();
                });
            },
            //获取第二天拜访计划
            get_tomorrowPlan: function () {
                var that = this;

                $.wyui.postMethod(urlConfig.report.tomorrowPlan.getByUserIdAndDateTime, {
                    "userId": that.userId,
                    "dateTime": that.today
                }, function (data) {
                    var len = data.length;
                    var obj = {};
                    for (var i = data.length; i < 9; i++) {
                        data.push(obj)
                    }

                    that.tomorrowPlan = data;
                    console.log("ccc" + that.tomorrowPlan);
                    that.tomorrowPlan.len = len
                });
            },
            //获取面访详情-区域经理
            get_visitPersonal: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.report.visitCustomer.getForPersonalDayByUserIdAndDateTime, {
                    "userId": that.userId,
                    "dateTime": that.today
                }, function (data) {
                    that.visit = data;
                    console.log(that.visit)
                });
            },
            //处理时速取整
            clearKil:function (data) {
                var data = data.replace("公里/小时","");
                data = Math.ceil(Number(data));
                return data+"公里/小时";
            },
            //去空格
            trims:function(data){
                console.log(data);
                var data = data.replace(/[ ]/g,"");
                return data;
            },
            //获取费用报表-个人模块
            get_costPersonal: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.report.reportCost.getForPersonalCostByUserIdAndDateTime, {
                    "userId": that.userId
                }, function (data) {
                    that.cost.list = data;
                });
            },
            //获取微信转发
            get_wechat: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.report.wechatShareRegion.getTodayWechatShareList, {
                    "userId": that.userId,
                    "dateTime": that.today
                }, function (data) {
                    that.wechat = data;
                });
            },
            //获取微信好友数
            get_wechatFriend: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.report.wechatShareRegion.getTodayWechatContact, {
                    "userId": that.userId,
                    "dateTime": that.today
                }, function (data) {
                    that.wechatFriend = data;
                });
            },
            //获取今日费用
            get_cost: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.report.reportCost.getForPersonalCostByUserIdAndDateTime, {
                    "userId": that.userId,
                    "dateTime": that.today
                }, function (data) {
                    console.log(data);
                    that.cost = data;
                });
            },
            //获取意向客户详情 -->大区经理级别
            get_bigRegionCustomerList: function () {
                var that = this;

                $.wyui.postMethod(urlConfig.report.intentCustomer.getForAppBigRegionIntentCustomerList, {
                    "userId": that.userId,
                    "dateTime": that.today
                }, function (data) {
                    console.log("222222222222" + JSON.stringify(data))
                    that.customerBig = data;
                }, true);

            },
            //获取意向客户详情 -->区域经理级别
            get_personalCustomerList: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.report.intentCustomer.getForPersonalIntentCustomerList, {
                    "userId": that.userId,
                    "dateTime": that.today
                }, function (data) {
                    console.log("333333333333" + JSON.stringify(data))
                    that.customer = data.records;
                }, true);
            },
            //打开大区经理意向客户列表
            openCustomerList: function (customerId, name, userId) {
                var that = this;
                var obj = {
                    type: 'lookPersonnel',
                    url: '/reportForm/customer/intentionalCustomerBigRegionApp.html?customerId=' + customerId + '&userId=' + userId,
                    name: name,
                    dateTime: ''
                }
                console.log(JSON.stringify(obj));
                prompt(JSON.stringify(obj));
            },
            //人员轨迹
            track: function () {
                var that = this;
                var obj = {
                    type: 'baiduTrack',
                    name: getUrlParamObj().userName,
                    id:getUrlParamObj().userId
                }
                prompt(JSON.stringify(obj));
            },
            //客户列表
            cusList: function () {
                var that = this;
                var obj = {
                    type: 'customerList',
                    url: '/reportForm/customer/customerPersonalListApp.html?userId=' + getUrlParamObj().userId,
                    name: '客户列表'
                }
                prompt(JSON.stringify(obj));
            },
            //查看人员基本信息
            lookDetail: function () {
                var that = this;
                var obj = {
                    type: 'customerList',
                    url: '/reportForm/personnel/entry.html?userId=' + getUrlParamObj().userId,
                    name: '基本信息'
                }
                prompt(JSON.stringify(obj));
            },
            getFunctionByTemplate: function () {
                var that = this;
                for (var i = 0; i < that.modules.length; i++) {
                    console.log(that.modules[i])
                    if(that.modules[i]=="serviceVisitPersonal"||that.modules[i]=="otherVisitPersonal"){
                        that.get_visitPersonal();
                    }else{
                        that["get_" + that.modules[i]]();
                    }
                }

            },
            //编辑计划
            plan: function () {
                var that = this;
                var obj = {
                    type: 'customerList',
                    url: '/reportForm/tomorrowvisitPlan/tomorrowVisitPlan.html?userId=' + getUrlParamObj().userId,
                    name: '编辑计划'
                }
                prompt(JSON.stringify(obj));
            },
            //获取工作报告
            get_workReport: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.wreport.wreport.emailReportForDay, {
                    "userId": that.userId,
                    "dateTime": "that.hour<17?'that.yesterday':'that.today'",
                }, function (data) {
                    that.workReport = data;
                });
            }
        },

        mounted: function () {
            var that = this;
            //获取所有APP模块 --> appTodayReport=1
            this.getModules();
            //通过拥有的模块调用各模块对应的接口
            that.getFunctionByTemplate();
            console.log(that.editable);
            console.log(that.hour);
            /* this.get_signInPersonal();
             this.get_tomorrowPlan();
             this.get_visitPersonal();
             //this.get_visitBigRegion();
             this.get_wechat();
             this.get_wechatFriend();
             this.get_cost();
             this.get_customerList();*/
        }
    });
</script>
</body>
</html>